Imports System.Windows.Forms
Public Class LogFile
    Public Sub WriteToLog(ByVal Text As String)
        Try
            My.Computer.FileSystem.WriteAllText(My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData & "\TagsLogFile.log", FormatDateTime(Now, DateFormat.GeneralDate) & ": " & Text & vbCrLf, True)
            MessageBox.Show("The program generated an error. The error has been logged to this file: " & My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData & "\TagsLogFile.log" & ". Please notify the developer by sending an e-mail (including the error-log) to the address found on the contact page at this website: http://tech.pederborgpoulsen.dk", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Catch ex As Exception
            MessageBox.Show("Error while writing logfile." & ex.Message)
        End Try
    End Sub
End Class
